package com.springboot.logger.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("log")
@RestController
public class LoggerController {

    final Logger logger = LoggerFactory.getLogger(LoggerController.class);

    @GetMapping("info")
    public void info(){
        logger.info("log info message:{}", "hello slf4j");
    }

    @GetMapping("debug")
    public void debug(){
        logger.debug("log debug message:{}", "hello slf4j");
    }


    @GetMapping("warn")
    public void warn(){
        logger.warn("log warn message:{}", "hello slf4j");
    }

    @GetMapping("error")
    public void error(){
        logger.error("log error message:{}", "hello slf4j");
    }

}

